package edu.ustb.efws.base.controller.form;

import edu.ustb.efws.base.domain.Position;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@ApiModel("新增风险点设置")
public class PositionSaveForm {
    @NotNull
    @ApiModelProperty(value = "温湿度传感器id", required = true)
    private Integer thoId;
    @NotNull
    @ApiModelProperty(value = "功率变送器id", required = true)
    private Integer iptId;
    @NotNull
    @ApiModelProperty(value = "该点位知否单独输出温湿度数据，0表示不输出，1表示输出", required = true)
    private Integer outTh;
    @NotBlank
    @Size(max = 20)
    @ApiModelProperty(value = "风险值输出点编号", required = true)
    private String outNumber;
    @NotBlank
    @Size(max = 20)
    @ApiModelProperty(value = "风险值输出位置")
    private String riskArea;
    @NotBlank
    @Size(max = 20)
    @ApiModelProperty("风险值输出点位置显示")
    private String riskPosition;

    public Integer getThoId() {
        return thoId;
    }

    public void setThoId(Integer thoId) {
        this.thoId = thoId;
    }

    public Integer getIptId() {
        return iptId;
    }

    public void setIptId(Integer iptId) {
        this.iptId = iptId;
    }

    public Integer getOutTh() {
        return outTh;
    }

    public void setOutTh(Integer outTh) {
        this.outTh = outTh;
    }

    public String getOutNumber() {
        return outNumber;
    }

    public void setOutNumber(String outNumber) {
        this.outNumber = outNumber;
    }

    public String getRiskArea() {
        return riskArea;
    }

    public void setRiskArea(String riskArea) {
        this.riskArea = riskArea;
    }

    public String getRiskPosition() {
        return riskPosition;
    }

    public void setRiskPosition(String riskPosition) {
        this.riskPosition = riskPosition;
    }

    public Position toDomain(){
        Position t = new Position();

        t.setIptId(iptId);
        t.setThoId(thoId);
        t.setOutTh(outTh);
        t.setOutNumber(outNumber);
        t.setRiskArea(riskArea);
        t.setRiskPosition(riskPosition);

        return t;
    }
}
